import { ActivityOrderStatusLabel } from '../constants/activity-order-status';

export function toOptions(labelValue: { [key: string]: any }) {
  return Object.entries(labelValue).map(([key, value]) => {
    return {
      label: value,
      value: key
    };
  });
}

const Lables = {
  ActivityStatus: ActivityOrderStatusLabel
};

type ConstantType = keyof typeof Lables;

export function useOptions(type: ConstantType) {
  return toOptions(Lables[type]);
}
